<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script>
		var arr=[1,2,3,4,5];
		var arr1=[4,5,6,7,8,9];
		var isHave=false;
		for (var i = 0; i < arr1.length; i++) {
			for (var n = 0; n < arr.length; n++) {
				if (arr1[i]==arr[n]) {
					isHave=true;
				}
			}
			if(isHave==true){
				isHave=false;
			}else{
				arr.push(arr1[i]);
			}
		}
		console.log(arr);
	</script>
</body>
</html>